package sk.tuke.constraintbuilder.builder.resourcemodel;

/**
 * Created by IntelliJ IDEA.
 * User: Brano
 * Date: 16.4.2011
 * Time: 20:31
 */
public class MethodElement extends ContainerElement {
    private String name;
    private String returnType;
    private ParamsElement params;


    public MethodElement(String name, String returnType) {
        this.name = name;
        this.returnType = returnType;
    }

    public void setParams(ParamsElement params) {
        this.params = params;
    }
    
    public ParamsElement getParams(){
    	return params;
    }
    
    public String getName(){
    	return name;
    }

    @Override
    public String generateXML() {
        return
        "<method" + addXMLAttr("name", name) + addXMLAttr("returnType", returnType) + ">"
                  + generateXMLSubElements()
                  + ((params != null) ? params.generateXML() : "") +
        "</method>";
    }
}
